<?php
    ini_set("display_errors", "on");
    date_default_timezone_set('America/Sao_Paulo');

  	// Define path to application directory
    defined('APPLICATION_PATH')
        || define('APPLICATION_PATH', dirname(__FILE__) . '/application');

    // Define application environment
    defined('APPLICATION_ENV')
        || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));

    try {
	    if(! require("configs/configuracao.php")) {
	        throw new Exception("Erro ao incluir o arquivo de configuração!");
	    } else {
	    	try
	    	{
		        $application = new Application();
		        $application->main('frontend');
	    	} catch(Exception $e) {
	    		throw new Exception($e->getMessage());
	    	}
	    }
    } catch(Exception $e){
    	echo $e->getMessage();
    }
